<?php

    // logged in
    if(isset($_SESSION['userID'])) {
        // read user data
        $res_user = execute_query("SELECT nickname FROM %PRE%user WHERE ID = ".$currentUser->getUserID(),$MySQL_DB);
        if($user = $res_user->fetch_object()) {
            // output logged form
            $template_vars = array(
                'userID' => $currentUser->getUserID(),
                'nickname' => $user->nickname
            );
            echo $this->getTemplate('logged_boxed',$template_vars);
        }
    }
    // not logged in
    else {
        // output login form
        $template_vars = array(
            'oldUrl' => getCurrentURL()
        );
        echo $this->getTemplate('login_boxed',$template_vars);
    }


?>